<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			body{
				height: 1500px;
				background-color: pink;
			}
			#aa{
			height: 200px;
				background-color: blue;
			}
			#bb{
				height: 100px;
				background-color: black;
			}
			*{
				position: 0;
				margin: 0;
			}
		</style>
		<script src="jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				$("#bb").css({"position":"sticky","top":"0"});
			})
		</script>
	</head>
	<body>
		<div id="aa"></div>
		<div id="bb"></div>
	</body>
</html>
